<template>
  <div id="subApp">
    <h2>
      基础数据子应用
      <span class="right">auth:weilan</span>
    </h2>
    <div id="nav">
      <span>切换路由：</span>
      <el-input v-model="text" size="small" :style="{width: '100px', margin: '0 0 10px 0'}"></el-input>
      <el-button-group class="right">
        <el-button type="primary" size="medium" @click="routerChange('/')"
          >表格</el-button
        >
        <el-button type="primary" size="medium" @click="routerChange('/about')"
          >日历</el-button
        >
        <!-- <el-button type="primary" size="medium" @click="toAppReport('/blog/')"
          >报表</el-button
        > -->

      </el-button-group>
    </div>

    <router-view />
  </div>
</template>

<script>
export default {
  name: "basic-app",
  props: {
    msg: String,
    message: String
  },
  data() {
    return {
      text: '12'
    };
  },
  created() {

  },
  methods: {
    /**
     * 路由切换
     * url 路由地址
     */
    routerChange(url) {
      this.$router.push(url).catch(err => {
        console.log(err);
      });
    },
    /**
     * 跨应用路由切换
     * url 路由地址
     */
    // toAppReport(url) {
    //   this.$mainUtils.routerGo(url);
    // },
    /**
     * 通知父应用变天了
     * type 通信方案
     */

  }
};
</script>

<style lang="scss">
.parent-child-communication {
  padding: 20px 0;
  line-height: 36px;
}
</style>>
